#ifndef __TERRAINBLOCKCOLOROPERATOR_H__
#define __TERRAINBLOCKCOLOROPERATOR_H__

#include <stl/list.h>
#include <standard/delegate.h>
#include "operator/operator.h"
#include "command/terraincolorcmd.h"

class CTerrainColorOperator: public IDelegateInterface, public COperator{
public:
    CTerrainColorOperator( CEditorSceneMgr* pSceneMgr );
    virtual ~CTerrainColorOperator();
    virtual bool32 Init();
    virtual bool32 Final();
    virtual bool32 OnLMouseDown( int32 x, int32 y );
    virtual bool32 OnMouseMove( int32 x, int32 y );
    virtual bool32 OnLMouseUp( int32 x, int32 y );
    virtual void _Work( int32 nCellX, int32 nCellY, int32 nBrushSize, color32 cBrushColor );

protected:
    void OnNotification_SetTerrainBrushType(int32 w, int32 l, void* pUserData);
    void _AddTerrainCellColorInfo( int32 x, int32 y, color32 cColor );
    void _FinishedWork();
    Ref< class CTerrainActiveBlockHelperObject* > m_rTerrainActiveBlockHelperObject;
    bool32 m_bIsButtonDown;
    int32 m_nButtonDownX;
    int32 m_nButtonDownY;
    int32 m_nButtonWorkX;
    int32 m_nButtonWorkY;

    map<uint32, color32> m_vTerrainCellHeightInfoList;
};

#endif
